package com.test.dubbo;

import com.test.dubbo.service.DomeService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

/**
 *
 * Created by lxy on 2017/7/13.
 */
public class Consumer {

    public static void main(String[] args) throws Exception {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
                new String[] { "dubboContext.xml" });
        context.start();

        DomeService demoService = (DomeService) context.getBean("demoService");
        String hello = demoService.sayHello("hejingyuan");
        System.out.println(hello);

        List list = demoService.getUsers();
        if (list != null && list.size() > 0) {
            for (Object aList : list) {
                System.out.println(aList);
            }
        }
//        System.in.read();
    }
}
